import { defineStore } from "pinia";
export const useUserStore = defineStore("userStore",{
	state(){
		return {
			openid:"",
			id:"",
			token:""
		}
	},
	actions:{
		setOpenId(id){
			this.openid = id
		},
		setId(id){
			this.id = id
		},
		setToken(token){
			this.token = token
		},
	},
	persist:{
		enabled:true,
		// key:"userStore",
		storage:{
			getItem() {
				return uni.getStorageSync(key)
			},
			setItem() {
				return uni.setStorageSync(key,value)
			}
		}
	}
})